<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<title></title>
	</head>

	<body>
		<script type="text/javascript">
			/*document.write("<h1></h1>");*/

			/*一 while(条件)
			{
				循环体
			}
			*/
			var s = 0,
				i = 1;
			while(i<=100) {
				s = s + i;
				i=i+2;
			}
			document.write("<h1>1加到100的和： " + s + " </h1>")
		</script>
	</body>

</html>